/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.pretorius.question1.polymorphism.model.impl;

import za.ac.cput.pretorius.question1.polymorphism.model.PrinterUser;

/**
 *
 * @author griddy
 */
public class SuperUser extends User implements PrinterUser{
    
    private String password;
    private String username;
    private int printCredit;

      
     public SuperUser() {
        
        super();
        printCredit = 0;
    }
     
     public SuperUser(String username, String password) {
        
        super();
        this.username = username;
        this.password = password;
        printCredit = 0;
    }
     
     
    @Override
    public int getPrintCredit() {
        return printCredit;
    }

    @Override
    public void incrementPrintCredit(int printCredit) {
        this.printCredit += printCredit;
    }
    
    @Override
    public boolean decrementPrintCredit(int printCredit) {
        if(this.printCredit > printCredit)
        {
             this.printCredit -= printCredit;
             return true;
        }
        else
           return false;
    }
    
    @Override
    public String getPassword() {
        return password;
    }

    @Override
    public String getUserName() {
        return username;
    }

    @Override
    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public void setUserName(String username) {
        this.username = username;
    }
    
 
    
}
